package com.zhenzhen.xszhcp.serviceImpl;

import com.zhenzhen.xszhcp.mapper.SemesterMapper;
import com.zhenzhen.xszhcp.model.Semester;
import com.zhenzhen.xszhcp.service.SemesterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public class SemesterServiceImpl implements SemesterService {
    @Autowired
    private SemesterMapper mapper;
    @Override
    public List<Semester> getSemesterList(Map paramMap) {
        return mapper.getSemesterList(paramMap);
    }

    @Override
    public Semester getSemesterById(int id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public int insertSemester(Semester semester) {
        return mapper.insertSelective(semester);
    }

    @Override
    public int delSemester(int id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public int upSemester(Semester semester) {
        return mapper.updateByPrimaryKeySelective(semester);
    }
}
